package com.design.softwaredesign.controller;

import com.design.softwaredesign.front.IwantInfo;
import com.design.softwaredesign.service.IwantService;
import com.design.softwaredesign.vo.DataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author :WaiterXiaoYY
 * @description: TODO
 * @data :2020/11/1 10:13
 */
@Api(description = "“我想要”控制层")
@RestController
@RequestMapping("/web")
public class IwantController {
    @Autowired
    private IwantService iwantService;

    @PostMapping("addiwant")
    public DataVo addIwant(@RequestBody IwantInfo iwantInfo) {
        return iwantService.addIwant(iwantInfo);
    }

    @GetMapping("/getIwantList")
    @ApiOperation("获取我想要列表")
    public DataVo getGoodsList(String userId, Integer pageNum, Integer pageSize, String query) {
        return iwantService.getIwantList(userId, pageNum, pageSize, query);
    }

    @PostMapping("/deleteIwantTraceById")
    @ApiOperation("删除预购记录")
    public DataVo deleteIwantTraceById(@RequestBody IwantInfo iwantInfo) {
        return iwantService.deleteIwantTraceById(iwantInfo);
    }

}
